<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <meta name="keywords" content="天地图"/>
    <title>天地图－地图API－范例－画布覆盖物类</title>
    <script src="echarts.min.js"></script>
    <script src="http://api.tianditu.gov.cn/api?v=4.0&tk=95f0a5688ec713adb3dd1735533f6fcb"></script>
    <script src="./EchartsOverlay.js"></script>
    <script>
    var zoom = 17;
    var width = 600;
    var height = 400;

    function onLoad() {
        // 添加地图
        var map = new T.Map('mapDiv');
        map.centerAndZoom(new T.LngLat(106.68243, 26.22207), zoom);

        // 添加 echarts 图层
        var point = [ 106.68243, 26.22207 ];
        var option = {
            title: {
                text: 'ECharts 入门示例'
            },
            tooltip: {},
            legend: {
                data:['销量']
            },
            xAxis: {
                data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
            },
            yAxis: {},
            series: [{
                name: '销量',
                type: 'bar',
                data: [5, 20, 36, 10, 10, 20]
            }]
        };
        var layer = new T.EchartsOverlay(option, { opacity: 1, point, width, height });
        map.addOverLay(layer);
    }
    </script>
</head>
<body onLoad="onLoad()">
    <div id="mapDiv" style="position:absolute;width:100%; height:100%"></div>
</body>
</html>
